/*
 * @(#)IQueryRunner.java
 * Date 2013-08-31
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.registry.query.es;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.elasticsearch.index.query.QueryBuilder;

import us.hornerscorners.lamppost.exception.ServiceActionError;
import us.hornerscorners.lamppost.exception.ServiceActionException;

import us.hornerscorners.lamppost.model.common.PersistableModelType;

import us.hornerscorners.lamppost.registry.model.QueryRequest;
import us.hornerscorners.lamppost.registry.model.QueryResponse;


/**
 * Class description
 *
 *
 * @version        v1.0, 2013-08-31
 * @author         Jim Horner
 */
public interface IQueryRunner {

    /**
     * Method description
     *
     *
     * @param request
     *
     * @return
     *
     */
    public abstract Map<PersistableModelType,
                        QueryBuilder> createQuery(QueryRequest request);

    /**
     * Method description
     *
     *
     * @return
     */
    public abstract QueryResponse run(QueryRequest request) throws ServiceActionException;

    /**
     * Method description
     *
     *
     * @param response
     *
     * @throws ServiceActionException
     */
    public abstract Collection<ServiceActionError> validateResponse(
            QueryResponse response)
            throws ServiceActionException;
}
